/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jkoa.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "akademik_subjek")
@NamedQueries({
    @NamedQuery(name = "AkademikSubjek.findAll", query = "SELECT a FROM AkademikSubjek a")})
public class AkademikSubjek implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected AkademikSubjekPK akademikSubjekPK;
    @Column(name = "kod_subjek")
    private String kodSubjek;
    @Column(name = "gred")
    private String gred;
    @Column(name = "nama_inst")
    private String namaInst;
    @Column(name = "tahun_grad")
    @Temporal(TemporalType.TIMESTAMP)
    private Date tahunGrad;
    @Basic(optional = false)
    @Column(name = "dimasuk")
    private String dimasuk;
    @Basic(optional = false)
    @Column(name = "trh_masuk")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhMasuk;
    @Column(name = "dikkini")
    private String dikkini;
    @Column(name = "trh_kkini")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhKkini;

    public AkademikSubjek() {
    }

    public AkademikSubjek(AkademikSubjekPK akademikSubjekPK) {
        this.akademikSubjekPK = akademikSubjekPK;
    }

    public AkademikSubjek(AkademikSubjekPK akademikSubjekPK, String dimasuk, Date trhMasuk) {
        this.akademikSubjekPK = akademikSubjekPK;
        this.dimasuk = dimasuk;
        this.trhMasuk = trhMasuk;
    }

    public AkademikSubjek(int idAkademikSubjek, int idAkademik) {
        this.akademikSubjekPK = new AkademikSubjekPK(idAkademikSubjek, idAkademik);
    }

    public AkademikSubjekPK getAkademikSubjekPK() {
        return akademikSubjekPK;
    }

    public void setAkademikSubjekPK(AkademikSubjekPK akademikSubjekPK) {
        this.akademikSubjekPK = akademikSubjekPK;
    }

    public String getKodSubjek() {
        return kodSubjek;
    }

    public void setKodSubjek(String kodSubjek) {
        this.kodSubjek = kodSubjek;
    }

    public String getGred() {
        return gred;
    }

    public void setGred(String gred) {
        this.gred = gred;
    }

    public String getNamaInst() {
        return namaInst;
    }

    public void setNamaInst(String namaInst) {
        this.namaInst = namaInst;
    }

    public Date getTahunGrad() {
        return tahunGrad;
    }

    public void setTahunGrad(Date tahunGrad) {
        this.tahunGrad = tahunGrad;
    }

    public String getDimasuk() {
        return dimasuk;
    }

    public void setDimasuk(String dimasuk) {
        this.dimasuk = dimasuk;
    }

    public Date getTrhMasuk() {
        return trhMasuk;
    }

    public void setTrhMasuk(Date trhMasuk) {
        this.trhMasuk = trhMasuk;
    }

    public String getDikkini() {
        return dikkini;
    }

    public void setDikkini(String dikkini) {
        this.dikkini = dikkini;
    }

    public Date getTrhKkini() {
        return trhKkini;
    }

    public void setTrhKkini(Date trhKkini) {
        this.trhKkini = trhKkini;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (akademikSubjekPK != null ? akademikSubjekPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AkademikSubjek)) {
            return false;
        }
        AkademikSubjek other = (AkademikSubjek) object;
        if ((this.akademikSubjekPK == null && other.akademikSubjekPK != null) || (this.akademikSubjekPK != null && !this.akademikSubjekPK.equals(other.akademikSubjekPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jkoa.model.AkademikSubjek[ akademikSubjekPK=" + akademikSubjekPK + " ]";
    }
    
}
